@extends('layouts.default') @section('main')
    <script type="text/javascript" src="{{URL::asset('js/')}}/ajaxfileupload.js"></script>
    <script type="text/javascript" src="{{URL::asset('js/')}}/common.js"></script>
    <script src="{{URL::asset('js/My97DatePicker/')}}/WdatePicker.js"></script>

    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i
                            class="icon-home"></i> 首页</a>
                <a href="{{url('ztc/list')}}" class="tip-bottom">活动管理</a>
                <a href="#" class="current">编辑活动</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span9">
                    <div class="widget-box">
                        <div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
                            <h5>查看一个活动</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <form action="{{url('act/edit')}}" method="post" id="adForm" class="form-horizontal">
                                <div class="control-group">
                                    <label class="control-label">活动id :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="act_id"   readonly value="{{$list->id}}" />
                                    </div>
                                </div>
                                <div class="control-group ">
                                    <label class="control-label">活动类型 :</label>
                                    <div class="controls ">
                                        <input type="text" class="span11" name="act_id"   readonly value="{{$list->type->name}}" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">活动主题 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="title"   readonly value="{{$list->title}}" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">活动举行日期:</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="date" value="{{date('Y-m-d H:i:s',$list->date)}}" onfocus="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})"
                                                 />                                    </div>
                                </div>
                                <div class="control-group ">
                                    <label class="control-label">一等奖奖项 :</label>
                                    <div class="controls ">
                                        <input type="text" class="span11" name="aNumeric" readonly  @if($aPrize)value="{{$aPrize->name}}"@endif   />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">一等奖数量 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="aNumeric" readonly  @if(isset($aPrize->setting))value="{{$aPrize->setting->num}}"@endif   />
                                    </div>
                                </div>

                                <div class="control-group ">
                                    <label class="control-label">二等奖奖项 :</label>
                                    <div class="controls ">
                                        <input type="text" class="span11" name="aNumeric" readonly  @if($bPrize)value="{{$bPrize->name}}"@endif   />
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">二等奖数量 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="aNumeric" readonly  @if(isset($bPrize->setting))value="{{$bPrize->setting->num}}"@endif   />
                                    </div>
                                </div>

                                <div class="control-group ">
                                    <label class="control-label">三等奖奖项 :</label>
                                    <div class="controls ">
                                        <input type="text" class="span11" name="aNumeric" readonly  @if($cPrize)value="{{$cPrize->name}}"@endif  />

                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">三等奖数量 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="aNumeric" readonly  @if(isset($cPrize->setting))value="{{$cPrize->setting->num}}"@endif   />
                                    </div>
                                </div>

                                @foreach($dPrize as $k=>$v)
                                    <div class="normal">
                                        <div class="control-group ">
                                            <label class="control-label">普通奖奖项{{$num[$k]}} :</label>
                                            <div class="controls ">
                                                <input type="text" class="span11" name="aNumeric" readonly  @if($v)value="{{$v->name}}"@endif  />
                                            </div>
                                        </div>

                                        <div class="control-group">
                                            <label class="control-label">普通奖{{$num[$k]}}数量 :</label>
                                            <div class="controls">
                                                <input type="text" class="span11" name="aNumeric" readonly  @if(isset($v->setting))value="{{$v->setting->num}}"@endif  />
                                            </div>
                                        </div>
                                    </div>
                                @endforeach

                                <div class="widget-title">
                                    <span class="icon"> <i class="icon-align-justify"></i></span>
                                    <h5>此次活动获奖者信息</h5>
                                </div>
                                <div class="control-group">
                                    <div class="controls">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <table class="table table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <th>获奖者</th>
                                            <th>奖品类型</th>
                                            <th>奖品</th>
                                            <th>姓名(邮寄用)</th>
                                            <th>电话(邮寄用)</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($winners as $v)
                                        <tr class="odd gradeX">
                                            <td>{{$v->realname or $v->nickname}}</td>
                                            <td>@if($v->type==1)一等奖@elseif($v->type==2)二等奖@elseif($v->type==3)三等奖@elseif($v->type==4)普通奖@endif</td>
                                            <td>{{$v->name}}</td>
                                            <td >{{$v->username}}</td>
                                            <td >{{$v->tel}}</td>
                                        </tr>
                                        @endforeach

                                        </tbody>
                                    </table>
                                </div>

                                <input type="hidden" class="span11" name="formType" value="edit" />
                                <div class="form-actions">
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    {{--<button type="button" id="doSave" class="btn btn-success">创建</button>--}}
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@stop
